Technically, Na2HPO4 is sodium phosphate dibasic, not hydrogen phosphate (the technical name tells you 1) the cation (sodium) and 2) how many protons are removed - dibasic meaning two removed protons). It is similar to phosphoric acid and often derived from it, but as you noted they are not the same compound.
Sodium phosphate dibasic, sodium phosphate monobasic (NaH2PO4), and phosphoric acid are all used in buffer systems. You can use combinations of them to get to different pHs. For example, instead of making a buffer from only phosphoric acid and then using sodium hydroxide to increase the pH, you can use various combinations of the dibasic and monobasic forms of sodium phosphate to get to different pHs (i.e. 20g dibasic and 10g monobasic will get you a more basic pH than 10g dibasic and 20g monobasic - note you can calculate the expected pH from different combinations, but that involves ICE tables, Ka values, and the like). This saves a lot of time, and is a common practice in labs as the buffers end up identical (titrating H3PO4 with NaOH to a certain pH is the same as adding the correct mixture of sodium phosphate dibasic/monobasic. You get the same molarity of phosphate, and the same pH).