How is the order of tasks determined?

By default, the tasks are arranged on a linear timeline based on their start and end time. So, the top most task in overdue is the one that was due ahead of all the other ones. The top most task in current is the one whose due date is expiring the soonest. In upcoming, the topmost task is the one that will become current the soonest. The tasks thus move from the bottom to the top as time goes by.