The Torah's subject here is explained by Rashi on verse 24:
אם מעיני העדה נעשתה לשגגה. אִם מֵעֵינֵי הָעֵדָה נֶעֶשְׂתָה עֲבֵרָה זוּ
עַל יְדֵי שׁוֹגֵג — שֶׁשָּׁגוּ וְהוֹרוּ עַל אַחַת מִן הָעֲבוֹדוֹת שֶׁהִיא
מוּתֶּרֶת לַעֲבֹד עֲ"זָ בְּכָךְ (שם ה'): —
This means: If it is by the
eyes (the leaders) of the community that this sin has been committed
in error, i.e., that they have mistakenly taught of a certain one of
the rites associated with the worship of God that it is permissible to
worship an idol in that manner, [then it shall be that all the
congregation shall offer, etc.].
So we see that the leaders of the community mistakenly allowed the people to perform “avodah zorah” idol worship believing that the manner of the worship was permitted and the people followed the teaching of the leaders.
and therefore verse 25 says
וְכִפֶּ֣ר הַכֹּהֵ֗ן עַֽל־כָּל־עֲדַ֛ת בְּנֵ֥י יִשְׂרָאֵ֖ל וְנִסְלַ֣ח
לָהֶ֑ם כִּֽי־שְׁגָגָ֣ה הִ֔וא וְהֵם֩ הֵבִ֨יאוּ אֶת־קָרְבָּנָ֜ם אִשֶּׁ֣ה
לַֽיהוָ֗ה וְחַטָּאתָ֛ם לִפְנֵ֥י יְהוָ֖ה עַל־שִׁגְגָתָֽם׃
The priest shall make expiation for the whole Israelite community and
they shall be forgiven; for it was an error, and for their error they
have brought their offering, an offering by fire to the LORD and their
sin offering before the LORD.
The leaders were at fault in issuing their teaching. The people erred by following the teaching.
So, verse 26
וְנִסְלַ֗ח לְכָל־עֲדַת֙ בְּנֵ֣י יִשְׂרָאֵ֔ל וְלַגֵּ֖ר הַגָּ֣ר
בְּתוֹכָ֑ם כִּ֥י לְכָל־הָעָ֖ם בִּשְׁגָגָֽה׃
The whole Israelite
community and the stranger residing among them shall be forgiven, for
it happened to the entire people through error.
And the meaning of “ stranger residing among them” will be as pointed out by @Double AA either a convert or resident alien who has certain religious obligations through his resident status including a prohibition of idol worship.
The leaders of the community bring the offering and must do Teshuva for their sin, as Rambam lays down in Hilchos Teshuva 1 (1).
Their sacrifices will not atone for their sins until they repent and
make a verbal confession as [Leviticus 5:5] states: "He shall confess
the sin he has committed upon it."
The people who erred by following the teaching of the leaders get atonement for that error (admittedly somewhat vicariously) through the repentance and offering of the leaders.