A yawn can in many species also be a conflict behavior. That is, when the animal is experiencing the conflict of 2 competing internal motivational states, let's say fear and hunger, then a yawn may appear. If there is a fresh piece of meat, and there's something guarding over that meat which the cat knows as a force to be reckoned with, then it may be confused under the stress of the situation. Dogs do this too. I often see this when working with dominant-minded dogs who want the food or the toy in my hand but don't want to do what I've asked, to sit or down, before they can receive it.
Sleep is a well-studied means of escape from stress, confusion, and conflict for many people.
And it can be for other animals as well.