Smart Loot was introduced to the Diablo franchise in the Diablo 3 Loot 2.0 update and will be a feature in Diablo 4.
What is Smart Loot?
Smart loot introduced a system where the game would roll item types and/or affixes appropriate for the class of the character that finds or crafts or gambles the item
In Diablo 3, around 85% of item drops or item rolls (crafting/gambling) roll with bonuses targeted at the class of the character. It's likely a similar rate will appear in Diablo 4.
Class-restricted items would never roll with a mainstat or +skill bonus not suited to the class being played. No matter which class found the item. stats would be rolled suited to the class the item was for. For example, in Diablo 3, Monk fist weapons will never roll with Int or Str, Wizard sources will never roll with Str or Dex, etc. A class-specific item will never roll with a mainstat or skill bonus that would be useless to its intended class.
To simplify, Smart Loot system rolls useful item types with the mainstat and skills appropriate for the class of the character that you are playing.
Farming for other Characters
In Diablo 2 it was easier to farm items for other characters on your account but when Smart Loot was introduced in Diablo 3, it became harder with a lower percentage of drops usable by other classes.
When asked about the changes with fewer drops for classes other than one you are playing in Diablo 3, Blizzard responded:
Not all drops will be smart drops. There’s only a chance that an item will be a smart drop (and thus tailored for your Barbarian), which means that you will still be able to farm upgrades for other characters on your account.
To counter Smart Loot, it will be important to be able team with players and exchange items depending on what item restrictions are in play by item tier.