In Open Channels, users can load all previous messages upon joining the channel.
On the other hand, in Group Channels, this behavior can be customized. In your Dashboard, under Settings - Messages, there is an option to Show Channel History. If this option is enabled, new users will able to access past messages of the channel.
You can further customize this setting (for Group Channels) using the Platform API. Here, you can change global settings, which will apply to every channel. Alternatively, by specifying a Channel Custom Type, it is possible to adjust the Show Channel History option for a specific subset of Group Channels.
Please reference the links below: