Both are law degrees, and the LLB is the first law degree that someone can obtain. It is the same as a Bachelor of Laws. This degree has been the common term given to somebody who has graduated or completed the law course or standard law program.
The LLB originated from England, and LLM is known as the Master of Laws. In most countries, having an LLB degree is looked at like a scholarly program in which additional training or education units are first required for the person to practice law. JD, on the other hand, is called Juris Doctor. One must have the JD to be admitted an LLM if they do not have any LLB received outside of the United States.
JD is the first law degree that acts as the primary training for lawyers in America. A thesis is not necessary to procure a JD. It was only until 1997 when this degree was made available in other countries, but there are some discrepancies with their versions instead of the original JD offered in America.