Why two separate installations are required for native plugins on capacitor project

Can someone please explain me why two separate installations are required for a a plugin in a capacitor project, If I install the plugin in 1st line, why I need to install it again in 2nd line ?
npm install cordova-plugin-flashlight
npm install @ionic-native/flashlight
ionic cap sync

The first install is the plug-in itself (ie the native code and base JS interface). The second install is the Typescript interfaces to the plugin.