When you're building wealth for retirement, it's often advisable to go heavy on stocks so your money can grow. But as retirement nears, it's common to reduce your exposure to stocks and shift more of your assets into bonds for stability and predictable income.
There's no single "optimal" allocation between stocks and bonds to aim for in retirement. The famous 4% rule for retirement withdrawals assumes a fairly equal stock/bond split, but there's wiggle room in that formula.