Kidney stones can lead to foamy urine which can cause your urine to have bubbles appear in your urine.
If you notice bubbles in your urine you should go get checked out to see if you have developed kidney stones.
Bubbles in your urine can also indicate high protein levels in your urine or can just be caused by a full bladder that gets released all at once at full force.