I heard that for example FedEx among others performs the majority of their flights during the night, the same goes for TNT. Is the reason for that is that during the day all of the freight is being collected and then loaded for delivery in the evening? Or is there another reason?
As the previous answers have stated, their schedules are determined by what best suits their needs. However, those schedules can be complicated by contractual and curfew requirements.
A contractual example: Thousands of expatriate Brits live in the south of Spain. They want their morning London papers. We would depart Stansted (just north of London) as soon as possible. We were contractually committed to have the load to Barcelona by 07:00 local, with huge penalties if we failed (the papers were worthless by noon), and then on to Palma de Mallorca. Hopefully by now, they transmit the papers electronically and print them locally.
A curfew example: A cargo flight departing Hong Kong bound for Chitose, Japan (refuel there then on to Anchorage). The old Kai Tak airport at Hong Kong had a 23:00 local curfew; Chitose had a curfew until 06:00 local. The solution to that was to depart Hong Kong just before the curfew, land at Taipei and park for a couple of hours (I forget the exact time), and then continue to Chitose to arrive just after 06:00 local.
All Japan airports at the time had a curfew from 23:00 local to 06:00. You could go out to the south end of the airport just before 06:00 local, and set your watch by the first arrival of what was tens of aircraft, both passenger and cargo, whose departure time was determined by the need to arrive as soon as possible after the airport opened
These cargo companies specialized in overnight delivery. Basically, they have their last pickups in cities in the afternoon/evening(depending on timezone/flight durations), and then load it onto the aircraft and then the aircraft fly to the hub(s), where it's sorted and then put on the next mode of transport(truck or plane), to get to their final destination. The cargo companies do fly during the day, but often it's either special flights, or their second day air cargo that they run(2 day service).
Another thing to consider, besides the need to get cargo to its destination in the morning (which is often but not always the case), is cost.
Many busy airports charge different fees for parking as well as landing and handling charges depending on time of day. That's also why many holiday charters fly at such ungodly hours, requiring the passengers to report for checkin at 2AM and the like. They don't do it because it's fun for their employees, they do it because it's the cheapest time for them to operate. It may not save that much, but a few Euros here and a few Euros there make up most of their profit margin.
And an additional bonus for cargo operators for arriving in the dead of night is that the road network their customers rely on to get the goods from the airport to its final destination tends to be less busy at night than during the day as well in many places.
Short answer is "logistics."
Many flights occur at night, but not all of them. The aircraft have to be repositioned.
First, they don't "only" perform flights at night, but many of the flights occur at night because of the logistics of shipping.
Taking UPS and FedEx as an example, many if not most of their business customers ship items during business hours. This means that during the day, the packages are making there way from offices, factories, stores, homes, to sorting facilities. Those cutoff times for next day delivery are based on how quickly they can get the packages to the last flight to the shipper's main hub. UPS (at least when I used to work there) used a hubs and spokes system on a very tight schedule. Where KSDF is the main central hub (there are other sub-hubs). It takes time to get the millions of packages every day from the shipper to the correct flights. In order for the system to get Next Day packages to their final destination, the days packages must be at their destination in the early AM so that they can be sorted and shipped around from KSDF to all of their main facilities, where they are further sorted and put into delivery trucks. If the flight leaves too early, then customer service suffers because Next Day packages can only be accepted early in the morning, the later the flight leaves, the more NextDay packages from customers can be accepted during business hours, even so, Next Day delivery usually has a cut-off time that is earlier than 5pm depending on your geographic location.
You can think of the UPS hub and spokes system as going out in early morning, and coming back a few hours after business hours (i.e. night flights). There was some local sorting and distribution, but most of the packages find their way back to the main hub (i.e. KSDF), or sub-hubs, in order to be put into the hub and spokes distribution system. So if you're shipping a nextday package from Southern California to Florida on UPS, the package would be picked up today, then transported to Ontario Airport (in southern California) where it would be sorted and placed into an aircraft container, this would be done between 5pm and about 8PM, then the container would be loaded on the last flight into KSDF which would depart about 9PM and arrived in KSDF early the next morning (due to time zones), then the package would be sorted and put on the Morning flight from KSDF to Florida where it would have to be sorted and put on a truck for delivery that same day.
While, in KSDF the aircraft that arrived from KONT would be loaded with packages going to the west coast and sent back to KONT. Where the whole process begins again.
NOTE: This is a simplified version of what happens, because it is highly complex, but you can see that evening flights make sense logistically, because the packages that are shipped during business hours have to make their way to the aircraft that flies back to the main hub. Local packages can be sorted locally for local delivery. Interestingly, there are occasions where a package will travel thousands of miles across the country only to be delivered a few hundred miles from where it was shipped. It just depends on the logistic channels that are available to the shipper.
UPS trivia: UPS operates its aircraft as an airline.
The business model for FedEx and similar companies focuses on the overnight transport of freight. So the bulk of the freight is moved after normal "business" hours.
However, there is freight which is transported by day, including same day delivery, second day delivery, etc.
But the bulk of the incoming freight reaches the local station after 4PM, as trucks return, drop boxes are emptied, etc.
Also, generally the planes have much more weight capacity than is needed for the freight. So the cooler evening air is not a big deal. It is significant that they get better ATC routing at night, however.
For anyone into algorithms, the optimization problems in loading and routing freight are significant.
Their most important customers are companies who generally work 9-5. They want to make the most of their workdays. So they want the carrier to deliver packages to them as early as 9am so they have the bulk of the day to process the work therein -- but take packages from them as late as 5pm (quitting time) so they can use the full day to produce.
Carriers give them the latter, unless it is logistically impossible to do so, and get reasonably near the former, typically delivering packages between 9 and 11:30 am if that is requested.
At 5pm, delivery trucks are running around collecting packages to be shipped. By the time they get to the regional distribution center at the airport, and the packages get inspected and go through their initial sort into containers and loaded onto planes, it's at least 8pm if not later.
They fly to the main distribution center (e.g. Memphis) where their packages enter the Big Sort. By the time new containers are filled and loaded, it will be probably 1-4am before planes are ready to depart. Their departure may be held further for higher priority aircraft to depart (they have farther to go) or so they arrive when the destination airport is open.
Any package which only paid for 2- or 3-day service may be "bumped" at any point if space is lacking. For instnace you can certainly pay for 2-day service from NYC to LA, but that is physically impossible to do with ground transportation, so it must be air -- and air can do it in 1.
A lot of airports are very congested -- think Heathrow, JFK, Mumbai, or SFO (if there's a cloud in the sky and therefore they have to close 28L).
For some reason, people don't like to fly at night. They like to fly during the day. The storm of passenger-flight activity tends to simmer down around 8 p.m.
These congested airports have limited runway capacity, and they tightly manage it by allocating, well, "slots"... but it's more complicated than that. The upshot is there's a lot of operational and financial pressure on freight carriers to mostly avoid peak passenger times.
For similar reasons, they try to limit their operations at busy airports (SFO, Montréal) and favor auxiliary fields (Oakland, Mirabel). While OAK is a busy 1-runway airport, it has an adjacent general-aviation field that is perfect for FedEx's smaller planes.
Cargo operators use passenger airports as well. Night flights for passengers aren't popular for a variety of reasons. Which means there are less flights for passengers landing and taking off during the night hours freeing up slots for cargo.
So it makes sense to avoid daytime rushhour for cargo that doesn't have a sleep cycle to mess up.
As stated very eloquently above, UPS, FedEx and TNT have a hub and spoke model and are takt'd process for sorting sending out, collecting sorting and distributing.
However, there are a few lesser known cargo operators that fly at night to take advantage of the cooler temperatures. With cool ambient air, the engines can produce more thrust before having the engines exhaust gas temperature exceeding operational limits. This is the case when the engines are getting close to needing an overhaul.
This means that the load master can plan with more weight and make for a more profitable flight. You will see some operators in middle America waiting for the temperatures to cool off before requesting permission for takeoff... Flowers and fish to Miami...