Can't fault AoA's explanation but on some aircraft there's a system reason as well. On a lot of aircraft, the Auxiliary AC Busses are dropped at the same time as the electrical Hydraulic & Fuel Pumps are switched on automatically as the Flaps deploy (typically > 3 degrees). to avoid overloading the Generators. Lighting is a large percentage of total electrical load and the "mood" lights (upwash & downwash) are often on the Auxiliary Busses hence they're dropped automatically as the aircraft is set up in takeoff configuration (and landing of course).
In cruise (Flaps 0), all electrical pumps are switched off (the Engine Driven Pumps and motor flow Injectors do the job) and the Auxiliary loads (lighting, Galley Power etc) come back on line.