How data get inserted into VendInvoiceRegisterLineEntity by UI

While creating Vendor Invoice Register for existing Vendor after saving the line details.

I can see the record gets inserted in the Entity: VendInvoiceRegisterLineEntity.

Then I have added the contact information for the vendor again another record gets inserted in the above entity which is duplicate record of above line details.

I tried to newly create a new vendor record without contact and create an invoice register line, then add a contact, i can see only one record in entity. Issue with existing vendor account.

Can anybody help to find out how the records are inserting into the entity by suggesting any class or method