How It Works
Some sources will tell you that the insurance follows the driver, and this is true if you have a liability policy. With this type of coverage, you're covered as long as you're driving an eligible vehicle (e.g., don't try to file for a motorcycle or an ATV of it's not specified in your policy). This coverage essentially covers you — meaning if you make a mistake on the road, your car insurance will apply to the cost of the damages. Of course, this only covers other people's property. It doesn't cover your car or possessions that may have been inside.
Exceptions to the Rule
Liability only will usually cover a one-off rental car or the borrowing of a friend's car. However, if the insurance company finds out that the insured was borrowing the car on a regular basis, then this may not be covered. An insurance company may require the driver to prove the reason why they were using someone else's car (e.g., their car was in the repair shop, etc.). The specifics will be stated in your policy (probably buried on the last page in the fine print).
If you have comprehensive and collision coverage, this usually follows the car that's insured. If you happen to have comprehensive, it may make sense to loan out your car without necessarily worrying about what will happen to it when it's out and about. However, there may be stipulations attached to the vehicle, such as who is allowed to drive it. An insurance company will work with people to some extent if there was an emergency or an odd situation, but they could also give you a hard time on the claim.
The best way to figure out your policy is usually to talk to an expert who understands the terms of your policy. If you know what to expect from your auto insurance, there will be no nasty surprises down the line.