The data grid widget allows you to export data as an excel file. The data on the page that you are viewing is exported. Because the maximum number of records that can be shown is 5000, you can export 5000 records at once.
If you need to export more than 5000 records, you need to create multiple exports, or work with a data garden export.
It would be very useful to allow for larger exports with an 'Export all" functionality, so you can set up an export functionality for users who do not need or want access to the entire data garden, but who do need to make exports of more than 5000 records.