There are two ways these apps can determine your location.
IF you have enabled Location Services, AND granted these apps access to your location, then they can determine your specific location via GPS receiver built into your phone.
Check Settings -> Privacy and Security -> Location Services
Scroll to Facebook, and see if it's enabled.
Separately from that, *any* site you access can intuit your location from your IP address.
Your device has an IP address that's used for all communication over the internet. There are databases that attempt to map IP addresses to locations. Most of the time they're close, but not perfect.
For example, it's easy to determine that a given IP address relates to a specific ISP, but that ISP might not expose more than city-level data - meaning they publish that the IP address is somewhere in your town (or some reasonable radius), but not down to street-level.
So even if Location Services are disabled, any site can still glean an idea of the general area you're in. The accuracy of this will depend a lot on your ISP.