Many2many fields always have an intermediary table where it's stored the foreign keys of the two tables, the actual were the field is m2m defined and the pointed table of the m2m field. Using that table the records of the other table can be retrieved. The following is a definition of a many2many field with the intermediary table in bold
invoice_line_tax_id = fields.Many2many('account.tax', 'account_invoice_line_tax', 'invoice_line_id', 'tax_id', string='Taxes', domain=[('parent_id', '=', False)])
In the case of the payment_ids of the model account.invoice it's a computed field so the records of the other table are retrieved using a the function _compute_payments of the account.invoice. The computed m2m fields don't have an intermediary table