AirPort on the Mac can determine its whereabouts by picking up signals from Wi-Fi networks (assuming that the machine is connected to the Internet). The collected location data isn’t supposed to identify you personally.
Still, if this wigs you out, deselect the Enable Location Services check box on the Privacy tab of the Security & Privacy pane in System Preferences to stop providing such information to various applications. Apps that want to use your Mac’s location are also listed, so deselect any of the programs that could theoretically benefit from knowing your whereabouts if you feel uncomfortable. If an app has requested permission to tap into your location within the past 24 hours, you see a tiny Stealth-airplane-looking icon that indicates as much.
You can still forbid a website from using your current location on a case-by-case basis, even if you don’t choose to disable Location Services. When you come upon a site that wants to know your location coordinates, you typically see a dialog asking for permission on the fly. Click Don’t Allow to deny permission or Allow to grant it.