Why are 'ghost flights' necessary?
Airliners are both larger and more complex than the small aircraft you're familiar with at your local flight school. For an example of some of the items to consider, see: What do you need to do to bring a 737 Max back in service after 6 months in storage?

A lot of those things won't be improved just by flying the plane periodically, but some items are. Tires can develop flat spots from sitting for too long. Engines and systems need to have their fluids circulated. Getting things warmed up and moving helps to prevent corrosion. Even with proper storage procedures, an aircraft would have to be thoroughly checked for any foreign debris or damage that could have accumulated.

As the article you linked states:


  Planes that have been grounded for a significant period have to be checked over before they are cleared to fly again, a process that keeps them from flying for even longer and costs the airline money.


There is of course a tradeoff between paying to put the aircraft in long-term storage, and later to bring them back into service, versus keeping them in working order. Also, as mentioned in the answer to the linked question, the flight crew need to fly a minimum amount to be considered "current" and allowed to fly passengers. Even aside from regulations, having periodic practice will help to maintain skills for everyone involved.

Having crews do a few laps around the airport helps to keep both the airplane and crew in working order, and avoids having to do more rigorous checks to get them back up to speed when needed, which can save both time and money.