For example, how does a servers NIC know that the client side is running a fibre optic connection
A NIC knows what kind of PHY is fitted. The physical-layer component is either part of the NIC or it's a modular transceiver (commonly SFP). A transceiver module includes an I²C chip that identifies it to the NIC (supported media, wavelength, speeds, reach, ...).
and so it can send more packets down the bandwidth?
Link speed is either implied by the type/module or negotiated. That speed is used for all data sent over the link.
The link speed is sometimes called raw bandwidth. The actual bandwidth depends on a lot more factors: data source, backplanes, possibly bottlenecks in the path, data sink and such. The actual throughput also depends on network congestion, send window and round-trip time, and so on.
Also, client and server aren't usually connected directly, so their respective link speeds can be vastly different. A server could be linked at 10 Gbit/s and serve a client dialed into a router with an analog modem with just 56 kbit/s. Effectively, that server could serve 178,000 such clients at their full speed simultaneously (provided there are no bottlenecks).
How does a NIC know how much data to send?
The NIC simply sends the data it is given, at the rate it is linked with. The data is provided by the application(s), passing through the OS's network stack.
If a transport-layer protocol like TCP is used that provides reliable delivery it'll throttle the data flow from the application to what the network can handle (by tracking acknowledgments from the flow partner and detecting network congestion - quite complex).
The NIC output may also be throttled at the data link layer by Ethernet pause frames, but that isn't widely used.