Sure, you can physically hand your ID or driver's license to your friend. And your friend may hold it in her hands momentarily, while pointing and laughing at the goofy look you're sporting in the picture. That friend can even pass it to another friend, while pointing and laughing and saying, "Look!" All of that is perfectly legal.
It's normally what happens after you give a friend your ID that matters.
There are plenty of legal scenarios in which you can give your ID to a friend. Perhaps you're going to the restroom and don't want to bring your purse. Maybe your buddy is in charge of a dry sack on a whitewater rafting trip. Or you have a close relationship with the bouncer at your corner bar. These are all perfectly acceptable times to give a friend your ID.
However, more often than not, you're giving a friend your ID for more nefarious purposes. Usually, your friend is younger and can't drive, buy cigarettes, or get into the bar yet. Or it could be that your friend is banned from a location and needs your ID to get in. If your friend intends to use your ID -- to pass herself off as you -- that's where you both could be in trouble.
The What Can Happen
Using a fake ID or using someone else's valid ID can lead to a slew of criminal charges. Though the penalties may vary, every state has laws regarding fake IDs, fraud, and identity theft that would apply to using someone else's personal information. And in some states, those can be felony offenses. And if you knew your friend was going to commit fraud with your ID, you could be charged as a co-conspirator, or independently as aiding or abetting the fraud.
If you or a friend have been caught using someone else's ID, you should contact an experienced criminal defense attorney immediately.