Mostly it is made by adding chemical preservatives to the foods that help to keep them fresh longer.
Also, proper storage can help to prevent the spoilage process.