All in all, they have the same head: BertForSequenceClassification has a dropout layer and a linear layer but uses the pooler output, which went through a linear layer inside the BertModel.
DistilBertModel has no pooler output however, so the first linear layer is there to replicate that.