In order to get a perfect lather you must be sure to get enough water into the soap so that small microscopic bubbles can be created. Various shaving soaps and shaving creams require different amounts of water but in common is that the best lather you will get by using a shaving brush.
With the brush you can whip air and water in. A good way to do it is to first soak the brush in warm water, bash off excess water, and then work up lather in an empty shaving bowl. You should whip until the foam is sticking to the dish if you turn it upside down. Just like when you make meringue!
A good test is to take a dollop of foam between your thumb and forefinger. It should not feel sticky. If it does, you need to add a few drops of water and whisk more until it is smooth and glossy.
Read more about the shaving brush in SLIQHAQ Academy.