On clicking on Add-to-cart, the price is added to cart, in Mini cart it shows cart subtotal and this cart subtotal is saved in the quote table database.
So my question is:
How is these cart subtotal is getting saved to database? from which file?
Take a look the Add to Cart controller
Go to the save method:
As we can see, Magento will use
Magento\Quote\Model\QuoteRepository to save the quote with collect totals to database.