DPI (dots per inch) in JPEG EXIF, JFIF or PNG pHYs tells a printer how to map pixels to paper. It does not change how many pixels exist. A 4000 × 3000 px image is 13.3 × 10 in at 300 DPI and 55.6 × 41.7 in at 72 DPI. The pixels are the same. Setting the tag from 72 to 300 without resampling does not add detail.
DPI Checker
See the DPI tag that is actually in the file, plus print size at 72 / 150 / 300 DPI from the pixel count. Changing 72 to 300 does not add detail.