Lane splitting is when you drive between other vehicles on the road. This is in contrast to following other vehicles.
You can do it when the other traffic is moving or sitting still. It is legal in California.
Be aware that not every state allows lane splitting. If you are driving out of California, it is your responsibility to know the law in the state in which you are traveling. If you lane split in a state where it is illegal, you will subject yourself to fines and penalties.
Legal but rules
While lane splitting is legal in California, there are still rules concerning the practice. Be aware that the practice in general can be risky. If other drivers do not know you are there, it puts you at risk for an accident. In addition, you have to be more alert when doing it. You cannot break other laws when lane splitting. For example, you still must obey speed limits. In fact, speeding could increase your chances of a crash and lead to more serious injuries if you do wreck.
Make sure also that the roadway is conducive to doing it. If it is narrow, it may not be smart to try to do it. Also, stick to the safest paths when lane splitting. This will usually be the far left lanes on the road. Just remember that lane splitting is not driving on the shoulder. This is still an illegal practice.
While you cannot completely protect yourself against other drivers, you can make sure that you pay attention and practice lane splitting as safely as possible.