How does youtube pick the related…

How does youtube pick the related videos?