The court has jurisdiction over the Plaintiff because by virtue of filing the lawsuit, the Plaintiff has subjected itself to the jurisdiction of the court.
A foreclosure action is against the property. As such, jurisdiction is proper where the property is located regardless of where the defendant (homeowner) is located. If the property is located in IL, then jurisdiction is proper in IL, period, end of story.
Foreclosure is purely a state law action.