Drilling data from entities in drupal 8

Still new to this drupal 8 beast and trying to learn how to drill down data from entites. There are this magic getters and setters methods that get you data without need to write them. So

$entity->get("name"); can also be written like $entity->name;  
To make this more complext lets try to get data from entity reference field where one entity has reference field to taxonomy and basically we are getting a term name.

It would be like this

$entity->field_positions_function->entity->name->value;

where we have $entity object loaded, then we go into field "field_positions_function" which is that magic getter, then we have entity property, then name magic getter and finally we get to value property.

For more info on this and related subject go here and read some useful info
https://drupal.stackexchange.com/questions/231285/how-do-i-find-availab…