The word swap means you give something in exchange for something else. In the medieval ages, a farmer would swap — or exchange — his cow for his neighbor's horse.
First used in the 1590s to mean "exchange, barter, trade," as a noun swap can mean an equal exchange. You might do a clothes swap with one of your friends in the hopes of perking up your wardrobe. As a verb swap describes the act of exchanging something for something else. You might swap oil for applesauce when baking brownies to make this treat healthier. In computer science swap means you move a piece of a computer program into memory.