Basically, the context gives it. 学校の生徒で could barely have the same meaning, but 学校の生徒でね is more common also in standard Japanese, so it might be safe to say that the context and な provide that meaning to the sentence.
学校の生徒だ just explains they are students, i.e., な gives the confirmation tone. Thus, 学校の生徒でな, 学校の生徒だな and 学校の生徒だ are all different.