A dynamic block rendering in PHP frequently needs a value from theme.json, and reading the file directly misses the merge with core and user styles.
$palette = wp_get_global_settings( array( 'color', 'palette' ) );
$content_width = wp_get_global_settings( array( 'layout', 'contentSize' ) );
// the merged result: core defaults, then the theme, then
// any user customisation from the site editor.
// and the styles side
$styles = wp_get_global_styles( array( 'typography' ) );
The merge is the reason to use the function rather than parsing the file — a value a user changed in the site editor lives in a wp_global_styles post, and reading theme.json returns the theme default. Both functions are relatively new and their signatures moved between 5.9 and 6.1, which is worth checking against the minimum supported version.