The uropygial gland is a bilobed structure located near the base of the tail in most birds, responsible for secreting an oily substance used for feather maintenance. This gland plays a crucial role in keeping feathers waterproof and flexible, which is essential for flight and insulation. Birds use their beaks to spread this oil over their feathers during preening, enhancing their ability to stay dry and insulated in various environments.