.textContent retrieves or sets the "raw" text content of an element, including all text within the element and its descendants. It ignores CSS styling, so it will return all text regardless of whether some of it is invisible (e.g., if it's obscured by display: none).
.innerText gets or sets the human-readable text content of an element, taking into account CSS styling like visibility: hidden or display: none. It will just return the text currently visible to the user and can also "normalize" spaces depending on how the text is formatted.
The reason why they may log the same thing in your instance is that if the element does not contain hidden text or any special CSS, both properties will return the same outcome. But they act in a different way once the text is hidden or styled in particular ways.