In the context of Apache Spark and Pandas UDFs, explain the role of Apache Arrow in the conversion process between Pandas and Spark DataFrames. Provide a detailed example of how you would use Apache Arrow to convert a Pandas DataFrame to a Spark DataFrame and vice versa.