"Short" answers -- "magistrates" in Texas are, broadly, anyone who fills a statutory judicial function: district court judges, municipal court judges, justices of the peace, county judges who preside over probate proceedings, etc.
Magistrate courts are used to conduct some hearings and other functions upon referrals from a district court judge. Magistrate court judges are appointed for one year terms rather than elected. Magistrate courts are mostly utilized to alleviate time stresses on district court calendars.
Federal courts also utilize magistrate judges in a similar fashion.
One of the judicial functions a magistrate court in Texas does not do is hear cases on the merits at trial. That function for felonies is reserved for district courts only. I think the same is true in the federal courts.
I'm generally a "statute nerd." The numerous statutes covering the functions of magistrate courts give me a headache.
Most likely this particular instance arose from her mental health screening that is part of the jail intake process.
http://www.dentonrc.com/local-news/local-news-headlines/20150825-cry-for-help.ece
That requirement is not always followed; Sandra Bland's confinement in the Waller County jail being a notable example of noncompliance.
Without knowing for sure, I am guessing that Tarrant County is in compliance and that Tonya Couch has either received mental health services/treatment in her past or has other indices of mental health issues that appeared in her intake.