why Nf6 is played against d4??

Sort:
Namrata_5
because it stops white from pushing the pawn
gargraves

To challenge the idea that white can follow d4 with e4 and build a big center. That is also the point of d5 as the response to 1.d4 as well. with either 1...Nf6 or 1...d5, e4 pawn push is not immediately possible. 3 Nc3 puts the idea of pushing e4 back on the table, by introducing a defender of the e4 square.

chyss

It also gives black the opportunity to lead the game in a different direction.

NikkiLikeChikki
It doesn’t commit to anything and can transpose into any number of openings without much downside. The only real downside is that you leave yourself open to the Trompowsky. The Trompowsky isn’t bad for white, but it can lead to weird positions that white is familiar with but black May not be.
ponz111

IT IS  MORE FLEXIBLE THAN 1. .... d5

[SORRY FOR CAPS-MEDICAL PROBLEM.]

Wildekaart

Because it's the most versatile response and prevents White to create the 'ideal' pawn centre by blocking 2. e4.
The latter is why 1...d5 and 1...f5 are Black's other two main moves against the Queen's Pawn opening.