Strength: Damage done with weapons
Perception: Finding weak spot of eneies (mirelurk face etc.) i've read that perception affects finding loot in NGD too. (not confirmed)
Endurance: The higher the endurance, the less radiation damage explorer takes and survives longer in wasteland.
Charisma: Interaction with NPCs (Talon Company mercs, slaves, trader etc).
Inteligence: Ability to heal wounded sheriff, fugitive slave, ability to repair damaged mr.Handy at 75th hour of exploring.
Agility: Fighting some fast enemies, maybe lowers damage taken.
Luck: Chance of finding loot (i don't know if it affects quality, but it definitely affects quantity).
All of them affects more things and when encounter triggers, dweller either pass or fail ability check and therefore gets diffirent results. Altough all 10 SPECIAL does not guarantee legendary from NGD and not even rares. I have currently dweller with all 10 and fancy formal wear (luck +7) outside and he has only some rares. Also dwellers have higher chance of finding better loot the more time they explore. When i am lucky, i get some rare the first day but after few hours of the second day, some rare is almost guaranteed.
Here is some great work of gentleman TunderProsum where you can find all observed events, chances of rewards, chance of loot based on time in wasteland etc.
https://docs.google.com/spreadsheets/d/1Nai09D_aM2syl3iPP5hkveDcOUwhsoUDR6s1lwC0e8c/htmlview?pli=1&sle=true#gid=1591448540
Here is main thread on reddit. If you like their hard work, please upvote to give them little reward
https://www.reddit.com/r/foshelter/comments/3a0p7v/room_efficiency_data_thread/
You are welcome.