These are only identical in equilibrium. Driven by the Consumption Function, introduced by John Maynard Keynes in 1936. See Figs 3.1 and 3.2 here. Investment Smaller than consumption but highly volatile. Note what matters is the real interest rate net of inflation.
Output is at an equilibrium when desired expenditure equals national income.
See Fig 3.6. Changes in National Output Consider a rise in autonomous expenditure, due, say, to a rise in investment. See Fig 3.8.