Firefox, saves all entered data with the value of the name attribute. Once it encounters the same name attribute, then autocomplete will be applied to it. If to speak of Chrome, it monitors how people filling out forms and when it recognizes the fields for the address and bank card details, asks if it should be saved for later use.
https://thetermpapers.org