If pseudorandom functions (PRFs) are deterministic in nature, how can encryption schemes using PRF be CPA secure? I am new to crytography. Can anybody tell me what I might be missing here?
The common way is to use a PRF for encryption is the CTR mode which is introduced by Whitfield Diffie and Martin Hellman in 1979;

Privacy and Authentication: An Introduction to Cryptography as an invited paper on Proceedings of the IEEE, 67 (1979), pp. 397–427.

This is a must-read paper that provides insight into the cryptography during 1970s. CTR mode doesn't need a PRP it can be work with a PRF and actually have better security bounds with the PFF( PRF-PRP switching lemma). To use the CTR mode with a PRF;

Choose a uniform random key on a key $k$

Choose a uniform random nonce ( counter-based are ok)

Generate the keystream $s_i$ as
$$s_i = PRF(key,nonce,i)$$

Encrypt the plaintext bit $p_i$ as $$c_i = p_i \oplus s_i$$


Like everything in cryptography, the CTR mode has advantages and disadvantages and the golden rule never uses an $(IV,key)$ pair again.
A well-known example is the ChaCha20 stream cipher based on the presumed ChaCha20 PRF.
CTR mode is CPA secure. To show the CPA security we need to play the Ind-CPA game.

Set the security parameter $1^n$
Call $Gen(1^n)$ to generate a key $k$
Provide $1^n$ to the adversary and Oracle Access to $E_k(\cdot)$
The adversary outputs the message $m_1$ and $m_2$ of the same length
Uniformly select a bit $b$ and send the ciphertext $c = E_k(m_b)$.
Adversary continue to using the oracle
Adversary outputcal_ $b'$
If $b=b'$ then output 1, else output 0.

Then, a scheme $\pi$ ( here CTR) is said to have Ind-CPA if
$$\Pr\left[ \operatorname{PrivK}^{CPA}_{\mathcal{A},\pi}\right] \leq \frac{1}{2} + \operatorname{negl}(n)$$
The proof is long to write here. See the Theorem 3.33 on the 3rd edition of Introduction to Modern Cryptography by Jonathan Katz and Yehuda Lindell
CTR mode is malleable, i.e. it cannot achieve CCA security. For this either use it together with a MAC like HMAC or use it in Authenticated Encryption mode fashion.

If pseudorandom functions (PRFs) are deterministic in nature, how can encryption schemes using PRF be CPA secure?

Yes, they are deterministic, however, the way we use them for encryption and decryption is probabilistic encryption. This is achieved even with the fixed key by using an IV/nonce per message. This is the sole reason that the advantage of the adversary is negligible.