Why do you keep asserting than an optional counting of anything has any affect on discrimination?
I didn't say anything of the kind. In fact, I explicitly said that a tickbox exercise like the OP's potential employer's form is of limited value.
Please explain the reason counting the number of anything is effective at stopping discrimination? Fascinated to find out. You seem very sure.
Again, that is not what I said. Just as counting crime does nothing at all to stop crime, collecting data about your workforce does nothing at all to stop discrimination.
Before you can address discrimination, you must show it happens. In order to show that (or find out whether) discrimination happens in a workplace, you need information about its workforce. That information is then categorized and analysed.
If the analysis shows that employees with certain characteristics (such as female staff) are treated less favourably than others not sharing those characteristics (such as male staff), this suggests that they are discriminated against on the basis of those characteristics (here it would be on the basis of sex). Employers, unions, staff or legislators can then take actions to remedy this.
That is the motivation behind data collection forms like the equality and diversity form the OP was asked to fill in. However, as I said earlier that way of data collection and monitoring is of little value.
In contrast, over the last few decades, the collection of comprehensive and complete workforce statistics has allowed us to see whether and where discrimination based on certain characteristics of an employee happens. Especially in the public sector, where monitoring of a limited number of characteristics is mandatory.
The two main ones are age and sex, followed by education, ethnicity, race, religion, sexuality and class. (Marital status once was an important category, but does not seem to matter now). Apart from the first two, however, employers today do not have the legal right to demand that an employee share that information with them.
Pregnancy and maternity are special categories as women are specifically protected from discrimination while pregnant and/or on maternity leave.
As for your question about what issues there may be with discrimination at work and why data collection matters, I can recommend Invisible Women by Caroline Criado Perez who not only shows why data collection is important, but also what happens when you don't.