what does "to take balls" mean?
"It takes balls to do X" means "it is necessary to be audacious to do X".
It's an informal phrase; "balls" in this context = "testicles", so some people would find it mildly offensive.
It differs from "it takes guts to do X" in that the latter usually implies approval of "doing X" on the speaker's part. ("Guts" roughly = "courage", a positive word.)
However, "it takes balls" is (usually) simply an acknowledgement of audacity.