Why are formation lights used,and why are they largely/always used only on military aircraft and not civilian?
Formation lights are used so that aircraft can fly close formation at night. They are typically luminescent strips positioned so that an aircraft can be in the desired position (i.e. fingertip formation) and have references fore-aft, up-down, and near-far similar to references as used for daytime formation flying. Something along the lines of, "keep the position light just below the formation light (strip) under the cockpit and the aft fuselage light (strip) just touching the wing hardpoint, and you're in the right position. If the position light goes farther below the strip, you're getting high; if the hardpoint is sliding back into the aft light you're getting close, etc."
Obviously these references are very specific to each individual aircraft.
You can see the formation lights in this picture of an F-14; the dots are actual position lights, while the strips are the formation lights. Source
As to why only military aircraft have them... how often have you seen or heard of civil aircraft flying formation at night? Yeah, me neither. There are very, very few non-military reasons for formation flight, and essentially none that require it to be done at night.
From the practical stand point I can remember vividly 2 times where the formation lights were invaluable. First, let me say I always used them while flying formation in clouds. They just gave you a little more light to fly off of. I flew A7-E's, light attack, single seat fighter jets off the USS Nimitz for 2 tours and was stationed in the soup of the Mediterranean.
With respect to flying in clouds I was with my lead as we were coming into NAS Cecil Field in the summer. It was a nice day and we were with approach control being vectored to the VFR initial at the speed. At some point we approaching a cumulus cloud and I tightened up my position on the lead. Entering the cloud he nearly disappeared from me. The cloud was the densest cloud I had ever encountered. I was tucked in uncomfortably tight and asked him to turn on his formation lights, which allowed me to see him better. Very useful that day.
The second time was with a training flight we did off the carrier. I was always looking for cunning ways to "train like you fight, and fight like you train." We often did intercept runs with the F14's at the end of our hops. We would be vectored on separate channels by the E2 to positions 20 nm apart with a 1,000 ft of altitude separation. Something like that. We would come toward the F14' at constant altitude and constant heading. The E2 and the F14's would practice vectoring in on targets, hand off, and target acquisition. We would pass by one another, head out, turn around and do it until we ran out of time, or they ran out of gas.
The other JO was the lead and it would be a beautiful night out there. Clear skies and a full moon. I asked Turk if he wanted to have some fun. "Sure, what do you have in mind?" I briefed the flight. Turk got airborne first and as is customary gave his departure call that he was airborne. This was so the E2 could keep track of who got airborne and who didn't. He went out to our rendezvous location and waited. When I got airborne I never made my departure call, and just headed out to join my lead. We went off and did our bombing on flares dropped on the ocean. After finishing that part of our mission we headed over to play targets for the F14's.
Inbound, before checking in with the E2, Turk turned off his anti-collision lights and had his formation lights on so I could nestle in close to his wing. This was okay because the E2 had Turks aircraft and kept separation for both us. We checked in and the E2 set us up for intercepts.
On the beginning of first run, I was tightly tucked in on my lead, and the E2 gave the F14 flight our contact information, "I have one target at 12 o'clock, 20,000 ft." The F14 lead confirmed the information, and then asked about the 2nd aircraft that was suppose to be in the flight. The E2 told them that they had no record of the aircraft getting airborne. They weren't buying it, and we listened on their radio frequency as they tried to piece together the fight as they were rapidly closing. "Where's the 2nd target?" At one point there was a call, "Got 'em!" He is at 5 miles abreast and 4,000 feet low." We had them.
Their search radars were capable of discriminating one target where there were 2. Visual can be obtained at around 8 miles and so when their vector was "12 o'clock at 8 miles," the lead turned on his anti-collision lights and I broke away doing the same, forming a pincer attack on the 2 unsuspecting fighters. When they saw 2 contacts where there had previously been one the trap was sprung. There were hurried calls of 2 targets separating, and ...
I ended up on the six of one of the 2 F14's and he was nose low in a descending right hard turn. When he hit burner I called a fox two, and looked over my shoulder high to the left and saw my lead chasing his F14 nose high in a tight left turn. When he went in to burner it was a beautiful sight, a long tail of flame from both exhausts and Turk called his shot. We were still turning. With experience, combined with graciousness, the other lead called, "Knock it off, knock it off," the the standard call to end an ACM engagement.
It dawned on me that we had never checked the flight schedule to see who would be the pilots in that flight. Was it the CO or XO? We were either lucky, or the F14 crews liked the training opportunity. That lesson will never be forgotten: "I don't want to be tricked like that again." Never heard back from the crew when we got back to the ship. You have to understand, we fought F14's pretty regularly and at best could hold them to a neutral fight. This was a nice friendly get back.