Senior liens before loans?

I try to understand this.? Why are there senior liens before the loans?? Shouldn’t they have been taken care of before the lenders lend money to the borrowers?? Why would lenders take the risk to lend money to someone that has liens?? Thanks.

Sean answered in another post… paraphrasing, that this is what is normal and expected, but this is why there is Title Insurance, there are mistakes made all the time where a lender misses it somehow in their earlier title search.