Well, I know if I'm listening to music or watching a movie or using software and I didn't pay for any of it, then morally speaking I'm cheating someone.
Not necessarily.
Much good software is free. If you insist on using Microsoft products without paying, that's a form of theft (please, don't say 'piracy'; there are no ships involved), but you can switch to Linux.
There are also lots of situations where you can listen to music or watch a movie without paying. Broadcast is the most obvious one, though the broadcaster has to pay.
Also, copyrights expire.
But what I guess I was wondering is what connection there is between that moral idea and actual copyright law. I suppose there must be some.
Plenty.
One principle, though, that is built into all copyright law is what US law calls "fair use". Things like quoting a work for comment or criticism, creating a parody of it, etc. are legal. That principle is just as basic as the notion of the creator having rights.
In some countries, things like photocopying a newspaper story for classroom use are considered fair use. In others they may not be.
In the US, there was a case with the TV and movie companies claiming "time shifting", recording something to watch later, violated their copyrights. In another, the record companies objected to "space shifting", such as people making cassette copies of records to listen to in the car. Both were fought all the way to the Supreme Court,and the media companies lost both. Those are perfectly legal fair use, at least in the US.