What Josh says is 100% correct. The IP address is collected when a lead is still anonymous and the inferred data is all we can tell about them. Once they fill out a form or interact with an email and become a known lead, all that inferred data comes across into the known lead.
You don't have to add anything special to a form to collect it, it's already there.
Be aware though, inferred data isn't always accurate. For example, right now I"m at home in Portland, OR. If I connected to the Marketo VPN and visited your page, it would show me as coming from San Mateo, CA.
In general, the widest area possible is most accurate. Country, for example, is pretty accurate (unless you have a remote employee or office in one country connecting through a network in another.) State is less accurate, city is less accurate than that, company probably not accurate at all (I work for Marketo, it would show you "Comcast" because that's my ISP).