There's a chip in the Apple cable. This chip is the MFI chip, and its only role is to let the Apple phone recognize that the line is certified by Apple, and if it does not pass the identification, it is considered that the line is not qualified, and it cannot be charged.
The MFI-certified data cable uses a chip-level certification, that is, the data cable must have an Apple-specified chip inside, and the chip must also be purchased from an Apple-designated distributor. The non-original data line does not need to pass any certification, only a simple chip needs to be built in to ensure that the user can be charged in a large probability.