How does the TCP/IP stack interact with Wifi components?
TCP/IP stack is designed to be generic as possible, so applications can interact with various data link protocols such as 802.3 (Ethernet), 802.11 (Wi-Fi), PPP (point-to-point protocol) and so on without needing to know what sort of link they are using..

TCP/IP actually comprises several layers of protocols, e.g.

 5. Application DNS, FTP, HTTP, IMAP, POP3, SMTP, SSH, Telnet, SSL, ...
 4. Transport   TCP, UDP, ...
 3. Network     IP (IPv4, IPv6), ICMP, ARP, ...
 2. Data Link   802.3 (Ethernet), 802.11 (Wi-Fi), PPP, ...
 1. Physical    Ethernet (NIC), Wireless (NIC), Cat 5/RJ-45, ... 


(The top layer is often broken out into three separate ones, I am simplfying things a little.)

So it will be the bottom level where the stack needs to interface with the driver for your specific Wi-Fi module.

Since this is at the byte level, there will be a limited number of functions that needed to be implemented.  They follow a pretty much standard I/O device driver model, i.e.

Open function
Close function
Send function
Receive function
IO Control function
Get PhysicalAddress function
Interrupt service routine (ISR) callback


so it should be pretty simply to marry up the stack interface with a particular module.

See here for an example with some more detail for one particular OS.

Some Wi-Fi modules, like the ESP8266, come with a TCP/IP stack built-in, since TCP/IP can be taxing on a small microcontroller.  It is accessed via AT commands, much like a cell module or Bluetooth module.