Different characteristic curves - different enough that if you process a roll of HP5+ & D400 to the same contrast index & contact print them you'll see it straight away. To my eye, there's something of a softer toed TX to D400 while HP5+ has a longer straight line. Regarding grain, D400 has a more complex/ sophisticated/ modern grain structure than HP5+, but how much of a difference that will make depends on a wide range of how big you print, formats you shoot & how objectionable you find HP5's grain (I don't).
Ilford's data sheet for D400 is probably one of their most comprehensive in terms of development time/ G-BAR contrast information. Personally I prefer the curve of HP5+ & am prepared to accept the somewhat grainier character of it - I'll use a bigger format if necessary.