The problem you are facing is incredibly complicated and does not have one simple solution (as you would expect).
There are two ways of going about solving captchas.
DBC : DeathByCaptcha, is a special API that is built around human-solving, but can introduce a delay of up to 8 seconds, and sometimes solves captchas incorrectly (although it's 90% accurate).
Another, much more expensive and way more complicated approach would be to do so via OCR-technologies. In the case of Google Captchas this is NOT POSSIBLE without thousands of dollars. In the case of simple, custom captchas, I'd use something like Neural Networks, although I would seriously consider using DBC.
Thank you, Have a nice day!