ansible_os_family is for assigning tasks, variables etc. to a family of operating systems (i.e Debian, RedHat etc)
Debian will match Debian, Ubuntu, any other derived Debian distribution
RedHat will match RedHat, CentOS, Fedora, any other derived RedHat distribution
the assumption is that in the same family the things are the same (i.e. apache is apache2 in Debian family, but httpd in RedHat family)
if you need finer grain you could use
ansible_distribution, which will give you the exact linux distribution
in most cases os_family will be enough, but when it comes to package versions (like php-7.x) maybe you will need also ansible_distribution_major_version
Alex