Open interest is the total amount of futures contracts in the market at any point in time.
Imagine a market which just opened this very moment and has zero participants. The first trader opens a short contract, and it gets bought by the second player – behold, the first contract created and the open interest went from 0 to 1. If these two entities close their positions against each other, the open interest will go back to zero. Each party can close their position against someone else, it doesn’t have to be the same party with which the contract was opened, in this case, the number of contracts will stay the same since one of the sides of the contract, has passed their obligations to another party.
Open interest only rises if new participants are joining the market, do not mistake it for trading volume. For example, if a trader has five open long contracts, and he sells them to someone else, he just closed his position on these contracts, but the buyer of those took his position, so the number of open contracts doesn’t change, while the trading volume rises by five.
Open interest only decreases when buying or selling of a contract is a closing position for both parties, they cancel out each other, and the contracts are out of the market. For example, two traders open five contracts each, one five longs and the other five shorts, if, when closing their positions, the market will match them against each other, they will close their positions and the open interest will fall by five.
A rise in open interest indicates new money is flowing into the market, while a decrease means people are leaving the market.