Session locking is pretty complicated, but here’s the gist of it. Just read the “Why is session locking useful?” section. Basically prevents Item Duplication and Loading Old Data.
Also I’d (PERSONALLY) reccommend Suphi’s over ProfileService as they are pretty similar but Suphi’s is more modern.