Why does this script do this?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FighterHealth : MonoBehaviour
{
public int fighterhp = 100;
public int currenthp;
public GameObject pexplosion;
public int projectiledmg;

Collider2D col;

bool isDead;
bool damaged;

    private void Start()
        {
            projectiledmg = GameObject.Find("Projectile").GetComponent<WeaponDMG>().projectiledmg;
        }

    void Awake()
        {
            currenthp = fighterhp;
            col = GetComponent<Collider2D>();
        }

    void OnTriggerEnter2D(Collider2D projectile)
        {
            currenthp -= projectiledmg;

            if (currenthp <= 0)
            {

                Death();
            }
        }

    void Death()
        {
            isDead = true;
            Destroy(gameObject);
            Instantiate(pexplosion, transform.position, transform.rotation);
        }

}

So this script is actualy working. But it does more then it should do. So i can shoot down enemy fighter the way i want to do. But if i ram the ship it acts the same way. so to say i can either shoot it 5 times or hit it 5 times with my spaceship. Why is it doing it? Any ideas what i must change to solve this?

Your fighter never checks to see what it collided with. It could collide with a projectile, another ship, a rock, anything at all, and it will always lose projectiledmg HP. If you want to change that, you’ll need to put checks inside your OnTriggerEnter2D method to see, for example, what the tag of the collision object is and decide how much damage to take from there.