This is a basic question so bear my ignorance. I feel like they contribute collectively in no way to the target. This is for performance and accuracy. The target is polar (0,1).
If your data samples are IID (independent and identically distributed) then you can remove the sample ID, given that all samples come from or refer to the same source/object and they don't somehow identify the sample class.
But, if your data is sequential, such as time series, it would be a big mistake to neglect the ID, as it identifies the time order between the samples. The time dependencies are a great source of information for problems such as time series forecasting, regression and classification. If you treat sequential data (time series) as IID (by removing the ID), you will have inferior performance, because you neglect one source of information, i.e. temporal dependencies. You should not include the ID as input to your model, but you should respect the order of the samples, which is shown by the ID.