```python
def max_occurrences(nums):
    """
    Finds the item with the maximum frequency in a given list.
    """
    if not nums:
        return None

    counts = {}
    for num in nums:
        counts[num] = counts.get(num, 0) + 1

    # Find the key (the number) that has the maximum value (the count).
    # The `key` argument of the max function allows us to specify a
    # function to determine the sorting criterion. Here, we use `counts.get`
    # to compare the numbers based on their frequencies.
    most_frequent_num = max(counts, key=counts.get)

    return most_frequent_num
```