First they collect your information, including your browsing history and share this data across its platforms such as blogger. The most controversial aspect to this is they collect customers data, this includes personal data which some find a breach against law.
The aim for this was to get searches more specified to what you would like and relevant to your searches, hence why you would get targeted ads to specific things you may have browsed earlier that day. This means good business for those advertising and to enhance the users experience by monitoring your habits. Remember they only share it with Google platforms, you have the ability to get more targeted advertisements to your interest saving you time to search. In a nutshell the Google algorithm collects your data and displays useful adverts that may be relevant to you.