I'm not sure what dermatologists do in general. I went to one a few years ago and she looks at my scalp through a big, magnified mirror, pulled at some of my hair to see if it would come out, said i had good hair folicles and it should grow back and that it was "likely" stress.
Basically a waste of money and she was extremely vague!!
Only later did i find out that not ALL dermatologists are trained to deal with hair loss. I would advise finding out whether the one you are going to visit has specific training in this field, otherwise it will be a waste of money.
For males it's generally genetic or hormonal eg: testosterone. Can be other issues, but they seem to be the most common.
For females it can also be genetic and hormonal. An excess of testosterone will cause loss of hair and/or male pattern hair growth. A lot more women rather than males will suffer with thyroid conditions, hormonal imbalance, low iron levels which all can cause hair loss. Malabsorbtion of vitamins/minerals due to digestion problems and gluten intolerance will also cause hair loss. Women pre/during/post menopause will end up with either hair loss or more dryer/brittle hair due to loss os estrogen.
I'm sure there are other factors which affect both males and females, but i'm most familiar with what ended up being my problem and that is low iron, thyroid condition, hormonal imabalance due to my thyroid condition, unable to digest protein sufficiently due to poor pancreatic enzymes in my system.
Stress can play a big part, but it's more often other issues or issues which you ending up getting due to long term stress.