I am replacing a vanity light in my condo. I removed the old fixture, which was a cheap long shallow box with five round bulbs. Lo and behold, there was no junction box behind the fixture, as all wires were contained inside the metal body of the unit and apparently one wasn't necessary. No studs behind the fixture either, so the old light was screwed into the wallboard. There was a hole in the wall and a thick white plastic coated cable encasing the three wires, ground, black and white. I added a shallow junction box that had to be installed directly over a ventilation pipe inside the wall (see photo) which came with a grounding wire attached to a screw. The light fixture has a grounding wire too. How do all three grounding wires get attached?
Just use an appropriately sized wire nut. Which is what you should also do for the black (switched hot) and white (neutral) connections.
If you're in the U.S.A., you can use standard wire nuts and connect all three grounds together. If you're in the UK, wire nuts are not allowed and you would have to use their screw type connectors.