The other comment is not quite right. The lieutenant governor, a mostly ceremonial figure, always gives the incumbent the first opportunity to test the confidence of the legislature, even if they lost the election.
In 2017 there was another close election, much like this one, with the BC Liberal Party (a now non-existent centre right party) as the incumbent retaining a plurality of seats, but not quite a majority. The BC NDP at the time was only a few seats behind. When the legislature returned after the election, the BC Liberals established a new cabinet and then tested the confidence of the legislature. The BC Greens and BC NDP all voted them down. At that point the lieutenant governor could have either called another election, or give a chance to another party to test the confidence of the legislature. Almost always the latter happens. The BC NDP had been in contact with the BC Greens in the background and it was then that the supply and confidence agreement was established so the lieutenant governor gave them the chance to test the confidence of the legislature and the BC NDP had enough to pass and form government.