Due to the system architecture of iOS/iPadOS, unless jailbroken, your iPad is not susceptible to traditional malware infection per-se. However, as with all computer systems, there are still vulnerabilities and exploits to which you remain vulnerable. For older devices, no longer benefiting from regular security updates, the risk of an unpatched vulnerability being exploited significantly increases.
While your iPad is unlikely to be directly infected by installable malware, your iPad can become a repository for infected files. While a locally saved file may not pose an immediate threat to your iPad (or iPhone), the file can still infect other susceptible devices (e.g., Windows PCs) if transferred to them.
In summary, malware is unlikely to be a concern for iOS/iPadOS devices that are kept updated to the most recent version of their operating system. All computers have vulnerabilities and exploits; iOS/iPadOS are perhaps less likely to be materially affected.