Often, in many versions of Star Trek, whoever is working with sensors reports life signs. They can detect life signs on other spaceships and on planets. They're even able to detect what type of life sign it is. (In The Enterprise Incident Checkov is able, with trouble, to distinguish between Romulans and a Vulcan.)
I remember at some point hearing a comment about using passive sensors only, which implies that there might be some type of energy beam sent so the sensor array can read the returning beam and the computer and use that to make conclusions about what is being detected. But that would mean that the beam is being reflected by whatever is inside a spaceship if it were detecting life signs in a ship.
I can buy that if the sensor picks up certain shapes, that the computer can decode them and determine if they're alive or not, but how does it get this information about distant objects in the first place?
How do sensors actually detect life signs on planets and on other spaceships?