How do prisons make money by taking in prisoners?

I hear this a lot around the net and haven’t taken any substantial amount of time to investigate. Do prisons make money off of keeping people behind-bars? I am told by others that prisons couldn’t possibly make money, only lose, please help my clarify this notion.

A government owned prison does not make money, it cost money to operate. This money comes from taxes and from court costs.

A private prison is paid by the government. They are given so much for every prisoner they house.