Why would you store related settings in a dictionary variable instead of separate variables like user1_first_name, user1_home_dir?
A dictionary groups all data about one thing under one name, so you don't have to encode the structure in long variable names. It is easier to read, to extend, and to loop over.
* The dictionary keeps each user's data together under one name. *
Flat variables encode the structure in the name:
user1_first_name: Bob
user1_last_name: Jones
user1_home_dir: /users/bjones
user2_first_name: Anne
user2_last_name: Cook
user2_home_dir: /users/acook
The same data as one dictionary named users:
users:
bjones:
first_name: Bob
last_name: Jones
home_dir: /users/bjones
acook:
first_name: Anne
last_name: Cook
home_dir: /users/acook
A dictionary (also "mapping" or "hash") is a set of key-value pairs, and a value can be another dictionary. Now "all users" is one variable you can pass to a loop, adding a user means adding one block, and the relationship between a first name and a home directory is visible in the structure rather than hidden in a naming convention.
Go deeper:
Dictionary variables (official docs) — defining and referencing dictionaries.
Associative array (Wikipedia) — the general data structure behind YAML mappings and Python dictionaries.