User gets added to the user information list if the when the users are explicitly added to the sharepoint site or when the users access the site.
Adding to below points,When we are trying to execute ensureuser from web level, user will be added to SharePoint User information list
When we grant any user permissions to a user, they are added automatically to the hidden User Information list a new item will be created in the User Information List storing some information about the user.Even though if we grant access to any active directory group the group gets added to the hidden User Information list as well but the user does not get added until they access the site.