Document raster setting has nothing to do with document size or export. Many people assume it does but it does not. Only affects filter effects and then probably only the way you intended to a vector format. For most users this setting does nothing.
Very long story short, adobe and perhaps the desktop publishing industry in general made a huge mistake someties in the period of 1960-1980's. The introduces the concept of resolution as a point pitch value. The problem is not so much about this value, but rather they forgot that not set is a perfectly valid value for this thing. So adobe is unable to set a raster document as having no conversion to physical units. Now because of this for all intents and purposes 72 PPI means not set, ill return to this in a moment.
Now illustrator offcourse has no resolution, or well it does not untill sometime after 1995 when people start to design for the web. Ok so now somebody decides that it would be great if one could design in pixels. Now its a bit too late to introduce the not set value, which would have solved this issue. But that would have ment we would needed to re-educate 2 generations of graphic designers*. So adobe was left with 2 options:
define a pixel as a unit. This is what they did because its ultimately easier. So Then they made a pixel preview that respects this and save routines meant for publishing to the web. As well as save routines for publishing for print (that do not assume there is a set resolution)
The other option would have been to introduce a setting for the user, but this would make pasting difficult. And who is to say you wouldnt want many settings for different areas of the docunent.
Now, you can not do any of this offcourse without shaking the world view of many users. But it works remarkably well for a ureconcilable problem. So at the end of the day if you think
Document has no pixels, but converted to pixels on render. Use the save options in file -> save and file -> export.
Documentbhas pixels then use save for web options which do underrtand pixels but not print settings so they aalways think the document is set to 72 PPI, which in this case means not set. Not that the document hjas a 72 PPI setting.
And in the off chance that you want to do both, then there is no solution but to rethink how the world really works.
Epilogue
Why 72 PPI, well it turns out adobe calculates things in postscript points. Which is a unit they have defined. They are just using a age old math/physics guide that says if you dont have a unit scale your computation so that number 1 is easy to deal with. They did that.
* in hindsight this would have been easy because now we would need to teach nearly four generations.