In NEM harvesting is the act of forming blocks (mining/forging). A harvester must have at least 10,000 vested XEM in his/her account and be running a booted and synchronized node. Once a block is formed by that harvester, a new block is added to the chain and all the fees collected from that block will be delivered to the harvester’s account.
NEM has additionally enabled a feature called Delegated Harvesting. This allows an account to request other people to form blocks and process fees for them, but done in a safe and secure way so that a person’s funds are not ever locked up, and fees are always given directly to the person that activated delegated harvesting, not the person that was harvesting for them.
If you didn't activate delegated harvesting explicitly, the default method will be used which is local harvesting. This method works only while your computer is running and as long as you are not using a remote NIS (NEM Infrastructure Server).
When you start local harvesting for an account, the private key of the account is passed to your locally running NIS. This is needed because NIS needs to sign generated blocks with your private key. The private key will of course not leave your computer at any time.
Harvesting is based off the Proof of Importance system. The more importance you have on the network, the more blocks you are able to mine. In turn, this means that you will profit more.