How are the totals updated on a quote saving?



Hi,
I understand the code but i need some in depth points on how it is getting stored and from where does the value fetched from.
It would really be helpful if you can explain it in detail.

Thanks