The market is an auction. Imagine a room with several people. half of them have contracts to sell. Half of them want to buy contracts.
Each person has a sign they hold up that has the price they are either willing to sell their contract for or a sign with the price they are willing to pay for a contract. If we line these people up from lowest to highest, you have a price ladder that is identical to the DOM.
so there will be a place in this line of people where one guy wants to buy and the next guy wants to sell. This is the inside bid/offer. These are limit orders. Eventually somebody has to compromise. the guy who who gives in and accepts the price of somebody else is a market order. Now those people will either leave the room or trade places in the line.
The buyers and sellers in this lineup are constantly changing their mind. The impatient people will change their price in order to move closer to the middle of the line where buyers and sellers meet, or further depending on how badly they want to buy or sell. This is how the inside bid/offer moves even though nobody has made a transaction. They may cut to the front of the line and this will tighten the spread. Or when two people in the middle make a transaction, everybody else might refuse to compromise and the spread may widen. If something scares everyone, the buyers and sellers may run to opposite side of the room. This is a volatile news event and why the spreads widen even though no trades took place.