I do not understand how she could do a land contract on a house that she still has a mortgage on without first talking to her bank?
The "how" is easy. She already did it. That's "how" she did it.
This is why I am wondering if what she did was even legal?
Yes, it was legal for her to contract to sell the house at some future date. Nothing even remotely legal about that and she has no obligation to get permission from the bank to do it.
The expectation is that what you pay her at time of purchase would be enough to pay off the existing loans. If it isn't enough then she would have to put up the cash to make up the difference.
Nothing illegal about that either.
Where this goes wrong is when she hits a financial snag and is unable to give you good title. Then she's in breach.
Now you get to decide whether it's worth paying an attorney a large amount of money to salvage the deal or whether it's worth walking away and taking your lumps.
You can lament "how can this happen" and sue till the cows come home but, If she's belly up financially, you can be 100% right and still lose it all.