There are definitely good quality AI detection tools available. These tools can identify if your text was generated by a machine because they analyze your writing in several ways (for example, they will analyze the pattern of your writing, how your sentences are constructed, how predictable your choice of words is, and how your entire piece of writing is structured).
The problem is that not all detectors are created equally. Some older/cheaper detectors will flag massive amounts of false positives or at all do not flag edited AI-generated text. Therefore, it is certainly advisable to use detectors that are trained on the most current models of AI and were also tested for their accuracy. An example of this would be the Quetexts AI Detector that checks a document line by line and has an associated plagiarism checker, so you can check both functions simultaneously. For more information on the way in which detection tools work, I would recommend reading Guide Regarding Accuracy in AI Detection Tools; it is very informative.