Persistent Segment Tree 03

Can you please explain how sir came up with equating the function <=k
Please explain the entire approach
I’ve tried watching it three times its still not clear