As others have said it’s a number of reasons airlines will leave aircraft on the ground all day. It could be to accommodate a take off or landing slot at a time within curfew, or to allow the planes to be timed to leave when passengers want to fly.
An example of the JNB situation is BA’s schedule. BA has traditionally operated two daily flights per day LHR-JNB both leaving in the evening. They arrive in JNB the following morning, remain on the ground all day and then depart again from JNB that night. BA then launched an additional thrice weekly flight LHR-JNB departing LHR early evening, arriving JNB the following morning, turning straight around and then flying a daylight flight back to London. While the outbound evening flight from London was very busy the return loads were dismal. Sometimes in double digits. This summer the thrice weekly flight has been rostered again although this third aircraft also sits on the ground all day to return home in the evening.
Some airlines will utilize this time on the ground to operate ‘shuttle flights’ to nearby cities or countries instead of sitting idle on the ground. BA used to do this in the case of SYD/BNE.