The phrase "to buy an essay" means to pay someone to create a written piece of work on a specific topic. It typically refers to purchasing an essay online from a writing service or from another person who will write it for you.