Does publishing greatly affect my chances of getting accepted and funded (TA/RA) in a PhD program?
It is not clear what you mean by publish. In the simplest form, with predatory publishers a check and some gibberish, and the gibberish might be optional, you can get published. Even respected publishers do not always peer review (e.g., ArXiv only moderates) meaning the quality does not need to be particularly high. To get published in a respected peer-reviewed journal, or conference proceedings, requires you, or the team you are working with, to produce novel and exciting research, write a clear description of the results, format the results to meet the journal's specifications, and address comments by reviewers.

Having been involved in the production of novel and exciting research is very helpful for admission to a PhD program. The ability to write up results is also important, but this can come across in your application and doesn't require a publication. Formatting to a journal's specification and dealing with reviewers is not something that admission committees really care about.

In general, publishing is the end product of the research process. Admission committees don't generally care if you make it to the end of the process.