This is a logic puzzle, not a grammar question. It would be better stated as Not all agreements are contracts, but all contracts are agreements. This is the relationship expressed by that sentence.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.