Units can have additional settings in
.d/ directories alongside the unit. For example,
foo.service can be extended via
Template units will use two directories – instance and template, so
getty@ttyS1.service will be extended from both
getty@.service.d/*.conf. This way you can extend all instances of the unit at once. In both cases, you the unit and its extension configs may use %i to get the "ttyS1" bit.
However, some units cannot use templates, e.g. slices (representing cgroups) are named
user-<UID>.slice and not
user@<UID>.slice because these units' name represents a filesystem path (the dash is mapped to a slash, and therefore "user-123.slice" is a child of "user.slice").
Because it is desired to be able to configure all individual user slices (e.g. give each slice x% of memory), a similar mechanism was added for units which use path-like names: similarly to the getty example above, the unit
user-1000.slice can be extended from both
user-.slice.d/, with files in the latter generic directory being able to use %j to get the "1000" bit.
This last example is sort of used in practice by the default systemd installation:
$ systemctl cat user-1000.slice
Description=User Slice of UID %j