How a state vault data and custom schema table we created is connected in Corda?

as I understand, there are two tables related to a state created in Corda,

  1. data is stored in vault_states as blob
  2. The schema table we created (which I suppose is only for custom vault query)

My question, is how these two tables are connected?

I saw the mappedSchema implementation and all, But, I am thinking about the connection or mapping between data that goes into both tables?

(I imagine for each txn with this state, will add data to vault_states & this second custom schema table in db, right?)