Non-Abelian gauge theories with composite fields are examined in the background field method. Generating functionals of Greens functions for a Yang--Mills theory with composite and background fields are introduced, including the generating functional of vertex Greens functions (effective action). The corresponding Ward identities are obtained, and the issue of gauge dependence is investigated. A gauge variation of the effective action is found in terms of a nilpotent operator depending on the composite and background fields. On-shell independence from the choice of gauge fixing for the effective action is established. In the study of the Ward identities and gauge dependence, finite field-dependent BRST transformations with a background field are introduced and utilized on a systematic basis. On the one hand, this involves the consideration of (modified) Ward identities with a field-dependent anticommuting parameter, also depending on a non-trivial background. On the other hand, the issue of gauge dependence is studied with reference to a finite variation of the gauge Fermion. The concept of a joint introduction of composite and background fields to non-Abelian gauge theories is exemplified by the Gribov--Zwanziger theory and by the Volovich--Katanaev model of two-dimensional gravity with dynamical torsion.