This flights are made mainly with the objective of moving people from a foreign country to their country of origin and are also generated when there is a physical threat to the citizens of a country due to different events or conflicts.
Governments are the ones who manage these flights with airlines or charter companies, and may also be in planes of the armed forces. Some countries have repatriation laws that guarantee the support of the state when its required by the citizen.
It will be the state who determines according to the circumstances if a flight is hired for humanitarian or repatriation purposes and even the financing of it, everything depends on what you want to achieve with the external communication of the same. Costs may be partially covered by the passengers, or the state may subsidize all the expenses.