Array math calculates with a whole set of cells. Multiplying units by unit cost produces one amount per row. SUMPRODUCT then adds those amounts. The ranges must have matching dimensions: an extra header or a missing final row changes the calculation or produces an error.
Conditions become arrays too. A comparison produces TRUE and FALSE. Multiplication converts those values to 1 and 0, so only matching rows contribute to the total. Multiplying conditions means both must hold; adding conditions means either may hold, but overlapping matches need a final greater-than-zero test to avoid counting a row twice. In Microsoft 365 these calculations use Enter. You don't need the legacy Ctrl+Shift+Enter shortcut.