Yawning is a reflex, that is, something that a nerve does so that a muscle reacts to it. Together with coughing and sneezing, yawning is one of the reflexes that have to do with breathing. In most cases, you yawn because you are tired.
There are also other reasons why people yawn. It can be from boredom or because your blood sugar is low. Yawning is also "contagious": you yawn because you see others yawning.
When you yawn, you breathe in deeply and out again. The mouth opens wide. This comes from certain muscles: that's why once you start yawning, it's almost impossible to stop.
Not only humans but also animals yawn. Mammals such as chimpanzees, dogs and cats have been observed to find yawning contagious. Some birds and fish have also been caught yawning. However, it is not known exactly whether they yawn for the same reasons as humans.