Texas counties have been around as long as Texas has been around. When Texas won its independence, the 23 local governments that had existed under Mexican authority became the first 23 Texas counties. To further organize and develop the new republic, more counties were created. By the time Texas became a state in 1845, there were 36 counties. And of course, today there are 254, which is by far the largest number of counties in any state.
There is often a misconception that counties have the same general authority as cities, but that is far from the case. Counties are basically extensions of the state government at the local level. Unlike cities, counties are NOT municipalities. Generally speaking, cities have the ability to make their own local laws and ordinances, as long as they do not conflict with state or federal law. Counties do not have that same authority. Counties can only do things they are specifically authorized to do by the Texas Constitution and Statutes.