Maryland uses a proportional representation system for party delegates; the full rules for the Democratic party are set out in this document. From a quick reading, it appears that 65 district level delegates are elected by direct vote, segmented by gender. i.e., an equal number of men and women who receive the most votes within their gender group and district. The presidential nominee numbers are used by the party to proportionally allocate 21 at large (statewide) delegates, as well as to adjust things like acceptance thresholds or correct imbalances in representation.
In other words, say I live in Congressional District 3, which has eight 'district' delegates, and goes 70% for candidate A, 30% for candidate B. The four highest men and four highest women on the ballot who meet a 15% threshold will become district delegates. If not enough men or women reach the 15% threshold, extra male or female delegates (respectively) will be chosen proportionally based on 70/30 candidate preference. And then 21 'at large' delegates will be selected proportionally by the party, based on 70/30 candidate preference.
It's a convoluted system meant to make the convention delegates as representative of the population of the state of Maryland as possible.