"Optimal bundle" for generic prices and income = Demand Function.
The "optimal bundle" changes when income or prices change: that is why we call it demand function.
For a specific utility (preferences) and given set of income and prices, we have learned how to find the optimal bundle.
If you solve this, so called, consumer's problem for generic income and prices $ (p_1,p_2,m) $, what you obtain is the demand function: $ x_1^{*}(p_1,p_2,m) $.
For example, if utility is Cobb-Douglas, then $ x_1^{*} (p_1,p_2,m) = \frac{a m}{ (a+b) p_1} $
A consumer's demand function indicates the optimal choice for a given set of prices and income.
$ x_1 = x_1(p_1,p_2,m) $
How does the optimal consumption of $ x_1 $ changes with changes in income? $ \frac{\partial x_1}{ \partial m } $ Vs. $ 0 $
$ \Delta p_1 $ tilts or pivots the budget line.
How does the optimal consumption of $ x_1 $ changes with changes in $ p_1 $? $ \frac{\partial x_1}{ \partial p_1 } $ Vs. $ 0 $
Gross Substitutes: $ \frac{\partial x_1}{ \partial p_2 } > 0 $
Gross Complements: $ \frac{\partial x_1}{ \partial p_2 } < 0 $