The purpose of the warm up is just what it sounds like, to warm up the core and muscle temperatures. This improves the flow of oxygen to the body, and flow of blood to the muscles. For every work out, the sequence of the warm up is different, but the principles on which the mechanics is based is the same. All warm ups should consist of the same two parts: a general warm up and a specific warm up.
The general warm up is conducted first and should be an exercise that helps warm up the entire body. Good examples of this are a light jog, jump roping, or other low impact/low resistance exercises.
The specific warm up is second in the sequence and is designed to help warm up the specific muscles being used during the workout. This is also known as a sports-specific warm up, and the exercises conducted during this period should increase in intensity for the workout. This section of the workout is often made up of dynamic exercises, meaning exercises that you will move through such as air squats, walking lunges, inchworms, and so on.
Depending on the workout and/or sport, you may also see stretching during this phase of the warm up. There is some debate on whether static stretching should be conducted before a work out because some studies suggest that it can lead to decrease in performance.
The simplest way to look at warming up is to realize that what is needed for a warm up differs based on the activity that will follow. For activities requiring increased flexibility, such as dance and gymnastics, static stretching should be done with the warm up. For those sports that require less flexibility, static stretching can wait to be conducted until the cool down period.