Turning tricks is a slang term for performing prostitution or having sex in exchange for money or drugs. From this phrase we get the term tricks, which is a word referring to a prostitute's clients.
Turning tricks is an American term. Some believe that it originally came from the French.
More About Turning Tricks
As little is known about the etymology of terms used in the sex industry, there is some conjecture about the origins of the phrase turning tricks. However, many believe that it came from the French term "trique" for "wooden stick." From this came the words "avoir la trique" or "triquer" which mean having an erection. In slang terms, "triquer" came to refer to a man having sex with another person in a careless, animalistic fashion. As this type of sex described the encounters men had with sex workers, triquer came to mean having sex with a prostitute. The English adapted the word, until it became turning tricks.
Another theory is that trick came from the American slang term for robbery. Prostitutes, at the turn of the 20th century, often robbed their patrons with the help of thugs. It's reasonable to suggest that this association helped spawn the term.
However, it could be as simple as trick meaning a mischievous act which speaks to the taboo nature of visiting prostitutes.
While turning tricks has come to mean performing prostitution in any sense, it's most commonly applied to the work of streetwalkers rather than prostitutes employed by brothels. When turning tricks in this sense, the prostitute services their clients in their car, a nearby public space like an alleyway or a rented motel or hotel room.