The central cargo hold is usually pretty big and open, if cargo was placed in loosely then it might shift in flight which can cause the center of mass to shift or damage the walls of the hold.
Putting them in containers and fixing those down will prevent that.
The containers can also be weighed before hand and their position set to ensure the center of mass ends up where it should be.
With loose cargo the pilot would need to rely on the intuition and experience of the loaders to ensure that they don't put all the heavy stuff on one side.
Loading loose luggage requires that the loader in the cargo hold handles each bag while stacking them.
The hold also needs to be full enough that the luggage can't shift around.
The smaller forward and rear cargo holds (or on smaller planes) can still accommodate loose luggage (or
more precisely they are too small for the containers to fit).
They will also have netting to provide barriers against shifting.
aviation.stackexchange.com/users/609/ratchet freak
Why is this required to be done?
As far as I know, this is not required by law, it is an operational practice by airlines.
According to Wikipedia "It allows a large quantity of cargo to be bundled into a single unit.
Since this leads to fewer units to load, it saves ground crews time and effort and helps prevent delayed flights.
"
Why don't they simply keep the luggage in the luggage compartment?
baggage can be loaded into ULDs while the aircraft they are intended for is still in flight.
This reduces turn-around time.
Aircraft only earn money when they are in the air, on the ground they bleed money from the airline's shareholders.
Airlines try to keep aircraft in the air and avoid having them on the ground as much as possible.
Why is loading the luggage piece-by-piece time consuming Because luggage is not of uniform size, shape and strength.
Therefore it is a labour-intensive process not especially amenable to full mechanisation.
It simply takes longer to load 50 (say) randomly shaped objects than it does to load one object of standardised shape and size. at the end, in second photo mentioned there, the luggage is being loaded piece-by-piece.
What is that?
I don't know, but it seems plausible that some passengers are willing to pay for their luggage to be carefully hand loaded.
I.e. first-class.
This allows those passengers to pay for an express boarding process and spend less time in the airport.
aviation.stackexchange.com/users/1289/RedGrittyBrick
Well there are several advantages of loading the luggage in unit load devices (ULDs) such as: In ULD, the luggage suffers much less shock than it would, if left alone.
Else, the incidence of baggage manhandling would increase several times.
We are already losing \$2.58 bn/year due to this.
ULDs lead to better use of aircraft cargo space.
Stacking the luggage one over the other would be a very time consuming and tiring job, and if it is not done, then a lot of cargo space of aircraft would be wasted.
ULDs help prevent this.
ULDs are cost effective.
Compare the cost of 100s people busy in stacking the luggage, and one conveyor belt doing the job.
ULDs are safer, in the way they prevent unauthorized access to the luggage.
And, in the second picture shown there, the luggage is being loaded into luggage hold.
Which has several Pallets/Nets for storing small ammount of luggage.
Usually, they are used to store some small cargo belonging to first class passengers.
aviation.stackexchange.com/users/8482/anshabhi
Think about the benefits of containerisation.
Ships could take days to unload if they carried many different items like lumber, sacks of corn etc.
Along came containers and now you can unload a ship in hours.
The labour intensive part of loading
/stacking is distributed toward the containers themselves, and thus frees up the expensive capital item such as a ship or plane to be turned around more quickly.
It all makes economic sense.
so is it required?
yes, if you wish to stay competitive and in business it is.
aviation.stackexchange.com/users/9710/pirate joe
There are some safety and security aspects to containing luggage within containers.
When content leaks, goes bad, or even explodes , the container may serve to limit the damage to other luggage within the aircraft, along with the aircraft itself.
aviation.stackexchange.com/users/995/CJBS
Also, if the airline is feeding flights to other destinations, baggage can be pre-sorted.
For example, a flight into CMB (Colombo, Sri Lanka) is commonly used as a feeder service for onward travel to MLE (Male, Maldives).
If all the MLE-destination bags are separated from the CMB-destination bags at the time of loading and are in their own ULDs, those ULDs can be simply moved into the MLE aircraft, saving the time to offload all bags, re-sort and separate the MLE ones, and then reload.
aviation.stackexchange.com/users/19784/Andrew
Luggage is loaded into containers, in Wide Body airliners (as mentioned  here ). Why is this required to be done? Why don't they simply keep the luggage in the luggage compartment? Why is loading the luggage piece-by-piece time consuming, and at the end, in second photo mentioned there, the luggage is being loaded piece-by-piece. What is that?
Why is luggage required to be loaded in containers?
aviation.stackexchange.com
<airliner><baggage-handling-system>
aviation.stackexchange.com/questions/17612
aviation.stackexchange.com/users/8482/anshabhi
Cargo is loaded onto aircraft in containers for several reasons. Firstly, it prevents the luggage from moving around during the flight, causing the center of mass to shift. Secondly, it localizes and spills or breakages. Thirdly, it provides for a better use of the cargo space. Finally, the luggage itself is protected from the shocks involved with moving around during the flight. Containers are also cost effective and prevent unauthorized access to the luggage. This not a legal requirement. One of the reasons for placing luggage in containers is so that the weight can be evenly distributed. Its also minimises the risk of damage and means that the cargo space is used more effectively. Using containers is also more cost-effective, less labour-intensive and safer, as it prevents unauthorized access.
Placing luggage in containers ensures that the weight can be evenly distributed. Loading the luggage piece by piece is more labour-intensive. This not a legal requirement. Loading the luggage in containers minimises the risk of damage to the luggage and to the aircraft. Loading the luggage in containers means that the cargo space is used more effectively. Using containers is cost-effective. Using containers is safer, as it prevents unauthorized access.