Because the object that owns the relevant state can answer the question most cleanly.
When methods live near the data they depend on, the model becomes easier to understand. That is one of the first real advantages of object-oriented design over a long procedural script.
Additional Notes
Why put behavior like `lineTotal()` on `CartItem`?