The other term for them are "backwire". There are varients that do this, but use the screws on the side to hold the wire in. Those are preferred over the spring-loaded backwire outlets and switches.
It sounds like it's either a three-way switch with no ground and someone using a combination of the side screw terminals and a back-wire, or they decided to make the splice with the switch. (which is NOT CODE) If it's a three way switch, one of the lines will always be hot from the switch that's feeding it- If there's another switch that turns the lights on/off that this one does, that's a positive indicator that it's a three way. (and using all black wires for that? Technically code, but confusing as all heck for whoever finds it later on, as you've discovered. usually the 'traveler' is red, but sometimes it's also white- the electrician is supposed to put black tape or marker on it to indicate that it's a traveller, but who knows.)
Also, ground wires are technically not needed IF (and it's a BIG IF) the box is already grounded. older switches and outlets lacking a green grounding screw should be replaced with a new one of the same function.
And if it's too much, or seems too complicated, call an electrician- house fires are no fun, and FAR more expensive than having a licensed electrician come out to take a look.
Re: The apprentice level elec-chicken's thoughts...
It sounds like it's either a three-way switch with no ground and someone using a combination of the side screw terminals and a back-wire, or they decided to make the splice with the switch. (which is NOT CODE) If it's a three way switch, one of the lines will always be hot from the switch that's feeding it- If there's another switch that turns the lights on/off that this one does, that's a positive indicator that it's a three way. (and using all black wires for that? Technically code, but confusing as all heck for whoever finds it later on, as you've discovered. usually the 'traveler' is red, but sometimes it's also white- the electrician is supposed to put black tape or marker on it to indicate that it's a traveller, but who knows.)
This site may be useful: https://www.electrical101.com/3way-switch-wiring-using-nm-cable.html
Also, ground wires are technically not needed IF (and it's a BIG IF) the box is already grounded. older switches and outlets lacking a green grounding screw should be replaced with a new one of the same function.
And if it's too much, or seems too complicated, call an electrician- house fires are no fun, and FAR more expensive than having a licensed electrician come out to take a look.