The term, "ghetto" was originated in Venice. It was used to describe the segregated area that Jewish people were living. they were segregated and had to live in that area, not just by their own choice.
The term was adopted to mean walled-off sections of cities for any minority group.
In WWII, Poland had ghettos that housed Jewish people were set up by the Nazis. and people were not only housed there, but could go come and go freely.
In the U.S., as many immigrant waves went through, the minority immigrants tended to be poor and live in areas that had the same religion, ethnicity, or race as themselves. They used the term ghetto, as well. Today, ghetto is still used to describe areas of town that have mostly poor minority people living there.