Harry went back in time when he died and so did Sirius after going through the Veil. Sirius, who gets shunted back to his teenage self a few years before Harry shows up, decides to accept his family's pressures and will marry Bella to avoid having her run off and join Voldemort if Andy is allowed to marry who she likes.
Sirius works his way to control the Black estate and seduce Bella with years of experience in both magic and witches and mitigate Voldemort's influence in his house and beyond. Cue 18 year old Harry's arrival at the same time when Lucius begins trying to approach Narcissa.
Sirius recognizing Harry's distinctive dress, quickly puts 2+2 together and sets up the game plan.