Engrams are an unknown loot item, though you know the rarity along with the type of item, e.g. legendary kinetic weapon, exotic helmet.
Weapons in D1 could be upgraded, in fact the higher level weapons had perks and abilities that needed to be unlocked before you could use them. It was a combination of experience to earn the ability to unlock the perk along with resources to actually unlock it. In D2 I am not sure how much of that has changed but probably similar in some ways.
This also included the “mods” like sights which were just a built in option like that. Unlocked the same way FYI.
You don’t explicitly level up after 20, but you have a light level which represents your average(?) light level of weapons and armor. This is used as a gate checking mechanism for encounters as well as a modifier to your overall power. Generally the higher light level you are the more powerful you are. If you have a lower average light level but have a very high light level gun, you would do less damage with the gun than if your light level was higher. This may or may not change.
No details on materials, but in D1 you picked them up and they were used to unlock abilities on weapons and could be used to trade for other resources. D1 had a ton of currencies you had to deal with so I hope they simplify that for D2.